<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ page import="java.util.*,
						org.apache.commons.logging.Log, 
						org.apache.commons.logging.LogFactory,
						com.ophelisis.common.util.*,
						com.ophelisis.common.consts.*,
						com.ophelisis.actions.system.*"%>

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="page" uri="/tld/xdp-page.tld"%>

<c:choose>
	<c:when test="${totalCnt != '' && !empty totalCnt}">
		<c:set var="totalCnt" value="${totalCnt}" />
	</c:when>
	<c:otherwise>
		<c:set var="totalCnt" value="0" />
	</c:otherwise>
</c:choose>

<script>
$(document).ready(function() {
	if (checkUserAuth() < 2) {
		$("#btnAdd").hide();
	}
});
</script>
<!-- Title Start -->
<%@ include file="/WEB-INF/jsp/common/resultMessageLocal.jsp"%>
<div id="formtitle">
	<input type="hidden" id="loadCheck" name="loadCheck" value="OK" />
	<form id="searchForm" name="searchForm" method="post">
		<table id="search" class="searchstyle1">
			<tr>
				<td class="title0">글 제목</td>
                <td class="input1"><input class="in3" style="width:200px;" id="searchVal1" name="searchVal1" type="text" value="${searchVal1}" /></td>
                <td class="btn1"><img id="searchBtn" src="images/btn/search.gif" class="clickable" /></td>
			</tr>
		</table>
	</form>
	<div>
		<div class="flo_r pdt10 pdb5"><img src="images/btn/btn_add02.gif" id="btnAdd" class="clickable" onclick="javascript:pmModule.setAdd();" /></div>
	</div>
	<table id="list" class="liststyle1 sortable">
		<colgroup>
			<col width="80" />
			<col width="160" />
			<col width="" />
			<col width="100" />
			<col width="100" />
		</colgroup>
		<tr>
			<th id ="0" class="sorting" scope="col">순번 <img src="images/icon/arrow_up.png" class="sortImg" /></th>
			<th id ="1" class="sorting" scope="col">카테고리 <img src="images/icon/arrow_up.png" class="sortImg" /></th>
			<th id ="2" class="sorting" scope="col">글 제목 <img src="images/icon/arrow_up.png" class="sortImg" /></th>
			<th id ="3" class="sorting" scope="col">최근 수정자 <img src="images/icon/arrow_up.png" class="sortImg" /></th>
			<th id ="4" class="sorting" scope="col">최근 수정일 <img src="images/icon/arrow_up.png" class="sortImg" /></th>
		</tr>
	</table>
</div>
<!-- Title End -->
<!-- List Start -->
<div id="formlist1" class="noborder">
	<table class="sortData liststyle1">
	    <colgroup>
			<col width="80" />
			<col width="160" />
			<col width="" />
			<col width="100" />
			<col width="100" />
	    </colgroup>
	    <c:choose>
	    	<c:when test="${boardList != '' && !empty boardList}">
				<c:forEach var="list" items="${boardList}" varStatus="status">
					<tr class="<c:if test="${list.boardId == _prevCode}">selected</c:if> <c:if test="${list.delYn == 'Y'}">tex_selected</c:if>">
						<td scope="col">${list.boardId}</td>
						<td scope="col">
						<c:choose>
							<c:when test="${list.categoryNm != '' && !empty list.categoryNm}">${list.categoryNm}</c:when>
							<c:otherwise>-</c:otherwise>
						</c:choose>
						</td>
						<td scope="col" class="tex_left"><a href="#" onclick="javascript:pmModule.getDetail('${list.boardId}','${list.delYn}');">${list.boardNm}</a></td>
						<td scope="col">${list.updateUserNm}</td>
						<td scope="col">${fn:substring(list.updateDatetime,0,10)}</td>
					</tr>
				</c:forEach>
			</c:when>
			<c:otherwise>
				<tr>
					<td id="nodata" colspan="5">- 해당 조건의 검색 내역이 없습니다.</td>
				</tr>			
			</c:otherwise>
	    </c:choose>
	</table>
	<c:if test="${totalCnt > 0}">
		<div class="pagenum" style="clear: both; display: inline;">
			<page:pagelist startRowNo="${_startRowNo}" totalCnt="${totalCnt}" action="boardPdsMgmt.action" displyRowCnt="${_pageSize}"></page:pagelist>
		</div>
	</c:if>
</div>
<!-- List End -->
